import { FC, memo } from 'react'
import { NoFoundWrapper } from './style'
import { useNavigate } from 'react-router-dom'

interface IState {
  children?: React.ReactNode
}

const noFound: FC<IState> = memo(() => {
  const naviate = useNavigate()

  // 点击去首页
  const goHome = () => {
    naviate('/home', { replace: true })
  }

  return (
    <NoFoundWrapper>
      <div className="text">
        <span className="tip item">页面消失去拯救星河系啦!!</span>
        <span className="btn_home item" onClick={goHome}>
          去救回页面吧!
        </span>
      </div>
    </NoFoundWrapper>
  )
})

export default noFound
